/**
 * Created by ZFL on 2017/11/12.
 */
var vm=new Vue({
    el:'#storeList',
    data:{
        storeList:[]
    }
})
function appInit(){
    PageInit();
}
function PageInit(){
    getstoreList()
}
var userId=$.getPara('userId');
var pageNum=1;
var pageSize=10;

function getstoreList(){
    $.ajaxHandler({
        model:function(){
            var obj={};
            obj.userId=userId;
            obj.pageNum=pageNum;
            obj.pageSize=pageSize;
            return obj;
        },
        visibleTime: 0,
        dataType: "json",
        approve:true,
        api: 'yg_baijiaappgoods/store/storeRecList',
        success:function(res){
            if(res.code==10000){
                var data=res.data;
                vm.storeList=data;


            }
        }
    })
}
$('.recruitBtn').click(function(){
    //console.log($.wxApi+"b2c/pay/addStores.html?inviterUserId="+userId)
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    var name='败家网络招募店主';
    var introduce='成为败家网络店主，享受店主优惠';
    //var url="http://h5.hm2019.com/b2c/pay/addStores.html?inviterUserId="+userId;
    var url= $.wxApi()+"b2c/pay/addStores.html?inviterUserId="+userId;
    var imgUrl='http://p1wxm3jet.bkt.clouddn.com/images/uploadImgForm/201805041739109989.png';
    if(isAndroid){
        //alert("安卓系统");
        JSAndroid.toShare(name,introduce,imgUrl,url);
    }else if(isiOS){
        //alert("苹果系统");
        //window.webkit.messageHandlers.shareBooking.postMessage(this.data.activity.id,this.data.activity.join_company_id);
        toShare(name,introduce,imgUrl,url);
    }
})